import { createSlice } from "@reduxjs/toolkit";

const countSlice = createSlice({
  name: "counter",
  initialState: {
    count: 0
  },
  reducers: {
    plus: (state, action)=>{
      console.log(state.count, action);
      state.count+=action.payload.value
    },
    minus: (state, action)=>{
      state.count-=action.payload.value
    },
  }
})

export const {plus:pAction, minus:mAction}=countSlice.actions

export default countSlice.reducer